package com.hewep.demo.device.mina.core.codec;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;
import org.apache.mina.filter.codec.ProtocolEncoderOutput;

public class DeviceCodecFactory implements ProtocolCodecFactory{
	
	private ProtocolEncoder deviceEncoder;
	private ProtocolDecoder deviceDecoder;	

	

	public DeviceCodecFactory() {
		this.deviceEncoder = new DeviceEncoder();
		this.deviceDecoder = new DeviceDecoder();	
	}

	@Override
	public ProtocolDecoder getDecoder(IoSession session) throws Exception {
		return deviceDecoder;		
	}

	@Override
	public ProtocolEncoder getEncoder(IoSession session) throws Exception {
		return deviceEncoder;	
	}


}
